package user

import (
	"context"
	"goAdminV1/internal/model"

	"github.com/gogf/gf/v2/errors/gerror"

	"goAdminV1/api/user/v1"
)

func (c *ControllerV1) DeleteUser(ctx context.Context, req *v1.DeleteUserReq) (res *v1.DeleteUserRes, err error) {
	// 调用数据库操作删除用户
	err = model.DeleteUserById(ctx, req.Id)
	if err != nil {
		return nil, gerror.New("删除用户出错")
	}

	return &v1.DeleteUserRes{}, nil
}
